home *** CD-ROM | disk | FTP | other *** search
/ Adventures with Oslo: Tools & Gadgets / Adventures with Oslo - Tools and Gadgets.ISO / pc / program / ad / mod03 / mstrmind.dir / 00061.ls < prev    next >
Encoding:
Text File  |  1994-09-23  |  2.7 KB  |  101 lines

  1. on startMovie
  2.   global gTools, guesses
  3.   set HC to the number of cast "handCursor"
  4.   cursor([HC, HC + 1])
  5.   if voidp(gTools) then
  6.     set gTools to []
  7.   end if
  8.   set guesses to [[], [], [], []]
  9.   put "(none" into word 1 of field "guess one"
  10.   put "(none" into word 1 of field "guess two"
  11.   put "(none" into word 1 of field "guess three"
  12.   put "0" into field "guess four"
  13. end
  14.  
  15. on getATool
  16.   go(the name of cast the castNum of sprite the clickOn)
  17. end
  18.  
  19. on oldGetATool
  20.   global gTools
  21.   if count(gTools) = 4 then
  22.     alert("Sorry, you can't carry that many tools.")
  23.   else
  24.     append(gTools, the name of cast the castNum of sprite the clickOn)
  25.     set the locH of sprite the clickOn to -200
  26.     updateStage()
  27.   end if
  28. end
  29.  
  30. on showTools
  31.   global gTools, guesses
  32.   deleteAt(guesses, 1)
  33.   append(guesses, gTools)
  34.   put field "guess two" into field "guess one"
  35.   put field "guess three" into field "guess two"
  36.   if field "guess four" = 0 then
  37.     put "(none" into word 1 of field "guess three"
  38.   else
  39.     put "(" & field "guess four" into word 1 of field "guess three"
  40.   end if
  41.   set spriteNum to 3
  42.   repeat with guessNum = 1 to 3
  43.     set guess to getAt(guesses, guessNum)
  44.     repeat with itemNum = 1 to count(guess)
  45.       set toolName to getAt(guess, itemNum)
  46.       put "light " before toolName
  47.       set the castNum of sprite spriteNum to the number of cast toolName
  48.       set spriteNum to spriteNum + 1
  49.     end repeat
  50.     repeat with i = 1 to 4 - count(guess)
  51.       set the castNum of sprite spriteNum to the number of cast "blank"
  52.       set spriteNum to spriteNum + 1
  53.     end repeat
  54.   end repeat
  55.   updateStage()
  56.   repeat with itemNum = 1 to count(gTools)
  57.     set toolName to getAt(gTools, itemNum)
  58.     put "small " before toolName
  59.     set the castNum of sprite spriteNum to the number of cast toolName
  60.     set spriteNum to spriteNum + 1
  61.     puppetSound(the name of cast (the number of cast "marimba1" + itemNum - 1))
  62.     updateStage()
  63.     wait(30)
  64.   end repeat
  65.   repeat with i = 1 to 4 - count(gTools)
  66.     set the castNum of sprite spriteNum to the number of cast "blank"
  67.     set spriteNum to spriteNum + 1
  68.   end repeat
  69.   puppetSound(0)
  70.   set temp to check(gTools)
  71.   if temp = 4 then
  72.     go("win")
  73.   else
  74.     wait(30)
  75.     put temp into field "guess four"
  76.   end if
  77. end
  78.  
  79. on wait ticks
  80.   set temp to the timer
  81.   repeat while (the timer - temp) < ticks
  82.   end repeat
  83. end
  84.  
  85. on check thisList
  86.   set total to 0
  87.   if getOne(thisList, "pick") <> 0 then
  88.     set total to total + 1
  89.   end if
  90.   if getOne(thisList, "pointy shovel") <> 0 then
  91.     set total to total + 1
  92.   end if
  93.   if getOne(thisList, "drill") <> 0 then
  94.     set total to total + 1
  95.   end if
  96.   if getOne(thisList, "ladder") <> 0 then
  97.     set total to total + 1
  98.   end if
  99.   return total
  100. end
  101.